<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template basic_text_ostream_backend</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Boost.Log v2">
<link rel="up" href="../../../sinks.html#header.boost.log.sinks.text_ostream_backend_hpp" title="Header &lt;boost/log/sinks/text_ostream_backend.hpp&gt;">
<link rel="prev" href="text_multifile_backend.html" title="Class text_multifile_backend">
<link rel="next" href="unbounded_fifo_queue.html" title="Class unbounded_fifo_queue">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="text_multifile_backend.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../sinks.html#header.boost.log.sinks.text_ostream_backend_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="unbounded_fifo_queue.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.sinks.basic_text_ostream_backend"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_text_ostream_backend</span></h2>
<p>boost::log::sinks::basic_text_ostream_backend &#8212; An implementation of a text output stream logging sink backend. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../sinks.html#header.boost.log.sinks.text_ostream_backend_hpp" title="Header &lt;boost/log/sinks/text_ostream_backend.hpp&gt;">boost/log/sinks/text_ostream_backend.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_text_ostream_backend.html" title="Class template basic_text_ostream_backend">basic_text_ostream_backend</a> <span class="special">:</span> <span class="keyword">public</span> basic_formatted_sink_backend&lt; CharT, combine_requirements&lt; synchronized_feeding, flushing &gt;::type &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">char_type</span>            <a name="boost.log.sinks.basic_text_ostream_backend.char_type"></a><span class="identifier">char_type</span><span class="special">;</span>    <span class="comment">// Character type. </span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">string_type</span>          <a name="boost.log.sinks.basic_text_ostream_backend.string_type"></a><span class="identifier">string_type</span><span class="special">;</span>  <span class="comment">// String type to be used as a message text holder. </span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span> <span class="identifier">char_type</span> <span class="special">&gt;</span> <a name="boost.log.sinks.basic_text_ostream_backend.stream_type"></a><span class="identifier">stream_type</span><span class="special">;</span>  <span class="comment">// Output stream type. </span>

  <span class="comment">// <a class="link" href="basic_text_ostream_backend.html#boost.log.sinks.basic_text_ostream_backendconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_text_ostream_backend.html#idp37533248-bb"><span class="identifier">basic_text_ostream_backend</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_text_ostream_backend.html#idp37534032-bb"><span class="special">~</span><span class="identifier">basic_text_ostream_backend</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_text_ostream_backend.html#idp37520704-bb">public member functions</a></span>
  <span class="keyword">void</span> <a class="link" href="basic_text_ostream_backend.html#idp37521264-bb"><span class="identifier">add_stream</span></a><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">stream_type</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_text_ostream_backend.html#idp37524000-bb"><span class="identifier">remove_stream</span></a><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">stream_type</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_text_ostream_backend.html#idp37526800-bb"><span class="identifier">auto_flush</span></a><span class="special">(</span><span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_text_ostream_backend.html#idp37529120-bb"><span class="identifier">consume</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_text_ostream_backend.html#idp37531792-bb"><span class="identifier">flush</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp141110640"></a><h2>Description</h2>
<p>The sink backend puts formatted log records to one or more text streams. </p>
<div class="refsect2">
<a name="idp141111312"></a><h3>
<a name="boost.log.sinks.basic_text_ostream_backendconstruct-copy-destruct"></a><code class="computeroutput">basic_text_ostream_backend</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp37533248-bb"></a><span class="identifier">basic_text_ostream_backend</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Constructor. No streams attached to the constructed backend, auto flush feature disabled. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp37534032-bb"></a><span class="special">~</span><span class="identifier">basic_text_ostream_backend</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destructor </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp141122080"></a><h3>
<a name="idp37520704-bb"></a><code class="computeroutput">basic_text_ostream_backend</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp37521264-bb"></a><span class="identifier">add_stream</span><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">stream_type</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> strm<span class="special">)</span><span class="special">;</span></pre>
<p>The method adds a new stream to the sink.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">strm</code></span></p></td>
<td><p>Pointer to the stream. Must not be NULL. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp37524000-bb"></a><span class="identifier">remove_stream</span><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">stream_type</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> strm<span class="special">)</span><span class="special">;</span></pre>
<p>The method removes a stream from the sink. If the stream is not attached to the sink, the method has no effect.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">strm</code></span></p></td>
<td><p>Pointer to the stream. Must not be NULL. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp37526800-bb"></a><span class="identifier">auto_flush</span><span class="special">(</span><span class="keyword">bool</span> f <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span><span class="special">;</span></pre>
<p>Sets the flag to automatically flush buffers of all attached streams after each log record </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp37529120-bb"></a><span class="identifier">consume</span><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span> rec<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> formatted_message<span class="special">)</span><span class="special">;</span></pre>
<p>The method writes the message to the sink </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp37531792-bb"></a><span class="identifier">flush</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>The method flushes the associated streams </p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2007-2014 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="text_multifile_backend.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../sinks.html#header.boost.log.sinks.text_ostream_backend_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="unbounded_fifo_queue.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
